<template>
    <div class="bigdiv">
        <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }">
            {{ number }}
        </van-divider>
        <van-form class="from">
            <van-cell-group inset>
                <van-field v-model="formvulue.entryName" label="项目名称" />
                <van-field v-model="formvulue.projectLeader" label="项目负责人" />
                <van-field v-model="formvulue.model" label="型号" />
                <van-field v-model="formvulue.belonging" label="所属部门" />
                <van-field v-model="formvulue.realDepartment" label="实在部门" />
                <van-field v-model="formvulue.serialNumber" label="序列号" />
                <van-field v-model="formvulue.position" label="客户硬盘？" />
                <van-field v-model="formvulue.customerDrive" label="客户序列号" />
                <van-field v-model="formvulue.chassisCondition" label="机箱" />
                <van-field v-model="formvulue.remarks" label="备注" />
            </van-cell-group>
        </van-form>
        <p style="display: flex; justify-content: space-around;">
            <van-button @click="gxfather('addEvent', false)" type="primary">关闭</van-button>
            <van-button @click="submit" type="primary">提交</van-button>
        </p>
    </div>
</template>

<script setup>
import { defineProps, onMounted, defineEmits, ref, reactive } from 'vue';
import { getjieshoulist, submitSQ, changelist } from "../../sevce/user";
import { showToast } from 'vant';
import { showNotify } from 'vant';
const props = defineProps({
    number: String,
    belonging: String,
    id: Number,
    equipmentName: String,
    entryName: String,
    model: String,
    realDepartment: String,
    serialNumber: String,
    projectLeader: String,
    applicationTime: String,
    position: String,
    customerDrive: String,
    usageSituation: String,
    equipmentStatus: String,
    processStatus: String,
    remarks: String,
    problemRecord: String,//问题记录
    checkStatus: Number,//检查状态
    checksTime: String,//检查时间
    chassisCondition: String,
    maintenanceRecord: String,
})

//赋值信息
const formvulue = reactive({
    id: props.id,
    entryName: props.entryName,
    model: props.model,
    belonging: props.belonging,
    realDepartment: props.realDepartment,
    serialNumber: props.serialNumber,
    projectLeader: props.projectLeader,
    position: props.position,
    customerDrive: props.customerDrive,
    remarks: props.remarks,
    chassisCondition: props.chassisCondition,
})
//检查确认
function submit() {
    changelist(formvulue).then((res) => {
        if (res.data == 0) {
            showToast('失败')
        } else if (res.data == 1) {
            showToast('成功')
            gxfather()
        }
    })

}


//修改完成更新数据
let emit = defineEmits(['updataaddEvent'])
function gxfather() {
    emit('updataaddEvent');
}
onMounted(() => {
    console.log(props)
})
</script>

<style lang="scss" scoped>
.bigdiv {
    margin: 0 10px 0 30px;
}

.from {
    height: 60vh;
    overflow-y: scroll;
}
</style>